﻿#ifndef COUNTDOWNWIDGET_H
#define COUNTDOWNWIDGET_H

#include <QWidget>
#include <QTimer>
#include "NixieTube.h"

class CountDownWidget : public QWidget
{
    Q_OBJECT
public:
    explicit CountDownWidget(QWidget *parent = nullptr);
    ~CountDownWidget();

    int GetSumTime( void ) const;

private:
    void InitUi( void );
    void InitProperty( void );

    void UpdateTimer(int timer);

signals:
    void reset();
    void timeout();
    void updatetime(int);

public slots:
    void on_start(bool start, bool pause = false);
    void on_reset();

private:
    QHBoxLayout *m_pRootLayout;
    NixieTube *m_pDecadeMinute;
    NixieTube *m_pTheUnitMinute;
    QWidget *m_pColonWidget;
    QWidget *m_pTopColon;
    QWidget *m_pBottomColon;
    NixieTube *m_pDecadeSecond;
    NixieTube *m_pTheUnitSecond;

    QTimer *m_pTimer;
    //int m_iTime;
    int m_iSumTime;
    int m_iMinute;
    int m_iSecond;

};

#endif // COUNTDOWNWIDGET_H
